package com.lzh.webservice;

import com.lzh.service.OrderService;
import com.lzh.entity.Orders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

import javax.jws.WebService;
import java.util.List;

/**
 * 服务端接口实现类
 */

@WebService(serviceName = "MyWebService"// 接口中的 WebService name
,targetNamespace = "https://webservice.lzh.com"// 与接口空间命名一致
,endpointInterface = "com.lzh.webservice.MyWebService" //接口地址
)
@Component
public class MyWebServiceImpl implements MyWebService{


    @Autowired
    OrderService orderService;
    @Override
    public String sendMessage(String username) {
        return "hello"+username;
    }


    /**
     * 订单获取
     * @return 订单
     */
    @Override
    public List<Orders> getOrders(String code) {
        // 根据code进行模糊查询

           List<Orders>  orders=orderService.getOrders(code);


        return orders;
    }



}
